function game(playerAction) {
  const arr = ['rock', 'paper', 'scissors']
  // 生成随机值不包含1
  const index = Math.floor(Math.random() * 3)
  const computerActioin = arr[index]
  console.log(`我出了${computerActioin}`);
  if (playerAction === computerActioin) {
    console.log('平局')
    return 0
  } else if (
    (playerAction === 'rock' && computerActioin === 'scissors') ||
    (playerAction === 'paper' && computerActioin === 'rock') ||
    (playerAction === 'scissors' && computerActioin === 'paper')
  ) {
    console.log('你赢了Joker');
    return 1
  } else {
    console.log('你输了Joker');
    return -1
  }
}

module.exports = {
  game
}